package org.jprogger.myworld.app.auth.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.jprogger.myworld.app.auth.model.AppUser;

public class AppUserHttpSessionService {

	public AppUser getAppUserFromHttpSession(HttpServletRequest request) {
		
		HttpSession session = request.getSession();
		AppUser appUser = (AppUser)session.getAttribute("appUser");
		return appUser;
	}
	
	public void setAppUserToHttpSession(AppUser user, HttpServletRequest request) {
		
		HttpSession session = request.getSession();
		session.setAttribute("appUser", user);
	}
}
